<!DOCTYPE html>
<html>
<head>
  <title></title>
</head>
<body>
<div id="app">
  <h2 v-if="order === 0">站在前排的 v-if</h2>
  <h2 v-else-if="order === 1">不上不下的 v-else-if</h2>
  <h2 v-else>负责垫后的 v-else</h2>
  <button @click="toggleTitle">切换标题</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.min.js"></script>
<script type="text/javascript">
  let vm = new Vue({
    el: '#app',
    data () {
      return {
        order: 0
      }
    },
    methods: {
      toggleTitle () {
        this.order = ++this.order % 3
        console.log('order的值为: ', this.order)
      }
    }
  })
</script>
</body>
</html>